home *** CD-ROM | disk | FTP | other *** search
- __.___ _.___.___
- _.____.___ \ < >___< /
- __/\__\. \| | .__|_ |_/\_
- / \/ /T \ : > | \
- / /\ \ \| | | |__ < /T |
- > \| < | / /__\ \| \| |
- | /_.___| /__._/| /| | /
- /__.___\ /______|AnG>__.___\__/_|.__\___/
- .:the:smaller:the:better:.
-
- Copyright (c) 1998-2000 by Joergen Ibsen / Jibz, All Rights Reserved
-
- ...ABOUT.........................
- ...LICENSE.......................
- ...COMPATIBILITY.................
- ...CONTENTS......................
- ...HOW TO USE....................
- ...FUNCTION DESCRIPTIONS.........
- ...GREETINGS AND THANKS..........
- ...GETTING THE LATEST VERSION....
- ...HOW TO REACH ME...............
-
-
- --- ABOUT -------------------------------------------------------------------
-
- aPLib is a compression library based on the compression algorithm used
- in aPACK (my executable compressor). I made this because some people
- needed an easy way to compress data-files.
-
- The compression speed is the same as aPACK (reasonably fast), and
- compression uses 640k of working memory.
-
- Decompression on the other hand does not need any extra memory (in situ),
- and is VERY fast.
-
- The depackers assume that they are given some valid packed code -- if not
- they will propably crash the program. This is to ensure that the depackers
- are as small and easy to understand as possible. If you need any added
- functionality (CRC-checking, encryption, depacked size stored with packed
- data, etc.), just add it yourself.
-
-
- --- LICENSE -----------------------------------------------------------------
-
- So far aPLib is GREET-WARE for non-profitable use (if nobody charges money
- for programs that use it) which means that if you use it, then you must
- credit me (well, ain't that cheap!).
-
- If you (or anybody else) plans to sell a program that uses aPLib, then you
- will have to register (look at the end of this file).
-
- The definition of a program that _uses_ aPLib is a program that contains
- any part of aPLib EXCEPT the depackers. So you can sell a program that
- uses data packed with aPLib, but NOT a program that contains any part of
- the compression code.
-
- You may not distribute aPLib without all of the files.
-
- You may not edit or reverse engineer any of the files (except the header
- files and the depackers, which you may edit as long as you do NOT remove
- my copyright notice).
-
- You may not sell aPLib, or any part of it, for money (except for charging
- for the media).
-
- #ifndef _COMMON_SENCE
-
- *** This software is provided "as is". In no event shall I, the author,
- *** be liable for any kind of loss or damage arising out of the use,
- *** abuse or the inability to use this software. USE IT ENTIRELY AT
- *** YOUR OWN RISK!
-
- *** This software comes without any kind of warranty, either expressed
- *** or implied, including, but not limited to the implied warranties of
- *** merchantability or fitness for any particular purpose.
-
- *** If you don't agree with these terms or if your juristdiction does
- *** not allow the exclusion of warranty and liability as stated above
- *** you are NOT allowed to use this software at all.
-
- #else
-
- Bla bla bla .. the usual stuff - you know it anyway:
-
- If anything goes even remotely wrong - blame _yourself_, NOT me!
-
- #endif
-
-
- --- COMPATIBILITY -----------------------------------------------------------
-
- The Watcom library works with (at least) Watcom, Borland C++, DOS32,
- TASM32/TLINK32 and VPascal -- and should work with other compilers/linkers
- that can use the OMF format.
-
- The VC library works with (at least) Visual C++, Masm32 and Watcom -- and
- should work with other compilers/linkers that can use the MS COFF format.
-
- The Delphi version works with Delphi and TMT Pascal.
-
- The DJGPP library works with DJGPP and Ada.
-
- The DLL version should work with any Win32 compiler/linker.
-
-
- --- CONTENTS ----------------------------------------------------------------
-
- The EXAMPLES\16BIT directory contains:
-
- DEPPACK.NAS ........... Source code for a 16bit depacker for files
- packed with aPPack (the Watcom example packer)
- in NASM style.
- DEPPTINY.NAS .......... Source code for a smaller version of DEPPACK.COM
- (no error or syntax messages) in NASM style.
- HISTORY.TXT ........... Log of METALBRAIN's work on the 16bit port.
- MAKEIT.BAT ............ Batch file to compile the above.
-
- The EXAMPLES\ADA directory contains the following files:
-
- APACDEMO.ADB .......... aPLib Ada demo.
- APLIB.ADB ............. aPLib Ada binding.
- APLIB.ADS ............. aPLib Ada specification.
- APLIBADA.DOC .......... Some documentation of the Ada binding.
- MAKEIT.BAT ............ Batch file to make demo executable.
-
- The EXAMPLES\C directory contains:
-
- APPACK.CPP ............ Example code that packs a file, depacks it again,
- and checks for errors.
- MAKE_BCC.BAT .......... Batch file to compile and link the above, using
- the Borland BCC32 compiler.
- MAKE_DJ.BAT ........... Batch file to compile and link the above, using
- DJGPP.
- MAKE_DLL.BAT .......... Batch file to compile and link the above, using
- VC++ (executable uses the aPLib dll).
- MAKE_VC.BAT ........... Batch file to compile and link the above, using
- VC++.
- MAKE_WAT.BAT .......... Batch file to compile and link the above, using
- the Watcom compiler.
-
- The EXAMPLES\DELPHI directory contains:
-
- ....................... An example packer and depacker written in Delphi.
-
- The EXAMPLES\DLL_ASM directory contains:
-
- APTEST.ASM ............ A little assembler code, that packs and depacks
- a message to show how the aPLib DLL works.
- APTEST.DEF ............ Definition file for the above.
- MAKEIT.BAT ............ Batch file to compile and link the above.
-
- The EXAMPLES\DOS32 directory contains:
-
- APTEST.ASM ............ A little assembler code, that packs and depacks
- a message to show how aPLib works with DOS32.
- MAKEIT.BAT ............ Batch file to compile and link the above.
-
- The EXAMPLES\TLINK32 directory contains:
-
- APTEST.ASM ............ A little assembler code, that packs and depacks
- a message to show how aPLib works with TLINK32.
- APTEST.DEF ............ Definition file for the above.
- MAKEIT.BAT ............ Batch file to compile and link the above.
-
- The EXAMPLES\TMT directory contains:
-
- APLIBU.PAS ............ A Pascal unit, to interface with the Watcom
- aPLib library.
- MAKEIT.BAT ............ Batch file to make demo executables.
- TESTAPDE.PAS .......... An example program, using aPLib with the above
- interface unit to decompress a file.
- TESTAPPA.PAS .......... An example program, using aPLib with the above
- interface unit to compress a file.
-
- The EXAMPLES\VPASCAL directory contains:
-
- APLIB.DEF ............. Interface Definition for APLIB.DLL (OS/2).
- APLIBU.PAS ............ A Pascal unit, to interface with the Watcom
- aPLib library.
- APLIBUD.PAS ........... Dynamic version of APLIBU.PAS.
- MAKE_EXE.CMD .......... Batch file to make demo executables.
- TESTAPDE.PAS .......... An example program, using aPLib with the above
- interface unit to decompress a file.
- TESTAPPA.PAS .......... An example program, using aPLib with the above
- interface unit to compress a file.
-
- The LIB\DELPHI directory contains:
-
- APLIB.OBJ ............. The object file that contains aP_pack.
- DEPACK.OBJ ............ Small decompressor (compiled version of
- DEPACK.ASM).
- DEPACKF.OBJ ........... Fast decompressor (compiled version of
- DEPACKF.ASM).
- READ.ME ............... Some info about using the above.
-
- The LIB\DJGPP directory contains:
-
- APLIB.H ............... Include file, that contains the declaration of
- aP_pack (the function that packs data),
- aP_depack_asm and aP_depack_asm_fast (depackers).
- APLIB.A ............... The library that contains aP_pack (and all the
- code needed to pack), aP_depack_asm and
- aP_depack_asm_fast functions.
-
- The LIB\DLL directory contains:
-
- APLIB.DLL ............. DLL containing aP_pack (and all the code needed
- to pack), aP_depack_asm and aP_depack_asm_fast
- functions.
- APLIB.H ............... Include file, that contains the declaration of
- aP_pack (the function that packs data),
- aP_depack_asm and aP_depack_asm_fast (depackers).
- APLIB.LIB ............. Import library for implicit linking with VC++.
- READ.ME ............... Some info about using the above.
-
- The LIB\VC directory contains:
-
- APLIB.H ............... Include file, that contains the declaration of
- aP_pack (the function that packs data),
- aP_depack_asm and aP_depack_asm_fast (depackers).
- APLIB.LIB ............. The library that contains aP_pack (and all the
- code needed to pack), aP_depack_asm and
- aP_depack_asm_fast functions.
-
- The LIB\WATCOM directory contains:
-
- APLIB.H ............... Include file, that contains the declaration of
- aP_pack (the function that packs data),
- aP_depack_asm and aP_depack_asm_fast (depackers).
- APLIB.LIB ............. The library that contains aP_pack (and all the
- code needed to pack), aP_depack_asm and
- aP_depack_asm_fast functions.
-
- The SRC\ASM directory contains the following files:
-
- DEPACK.ASM ............ Small decompressor in 32bit assembler code for
- TASM, MASM or WASM assembler.
- DEPACK16.ASM........... Decompressor in 16bit assembler code for TASM,
- MASM or WASM assembler.
- DEPACKF.ASM ........... Fast decompressor in 32bit assembler code for
- TASM, MASM or WASM assembler.
- READ.ME ............... Some info about compiling and using the above.
-
- The SRC\C directory contains:
-
- APDEPACK.C ............ Decompressor in C.
- APDEPACK.H ............ Include file for the above.
-
- The SRC\NASM directory contains:
-
- DEPACK.ASM ............ Small decompressor in 32bit assembler code for
- the NASM assembler.
- DEPACK16.ASM........... Decompressor in 16bit assembler code for the
- NASM assembler.
- DEPACKF.ASM ........... Fast decompressor in 32bit assembler code for
- the NASM assembler.
- READ.ME ............... Some info about compiling and using the above.
-
-
- --- HOW TO USE --------------------------------------------------------------
-
- So basically you include APLIB.H and link with the library to be able to
- pack and depack. If you only need to depack, or if you modify the depack
- code, you can compile and link with one of the assembler versions of the
- depackers.
-
- Getting data into an input buffer and allocating the output buffer is your
- responsibility. You also need to supply a work buffer for aP_pack -- you
- can get the required size of the work buffer by passing the size of the
- input to the function aP_workmem_size (in the current version this
- function always returns 640k). If some error occurs, aP_pack will return
- 0 -- otherwise it returns the compressed size.
-
- If you do not have a callback for aP_pack, use NULL (ie. 0) instead.
-
- The EXAMPLE directory contains simple packers for various languages that
- either use aPLib to compress and decompress a given file, or a string.
-
-
- --- FUNCTION DESCRIPTIONS ---------------------------------------------------
-
- aP_pack:
- --------
- unsigned int aP_pack(unsigned char *source,
- unsigned char *destination,
- unsigned int length,
- unsigned char *workmem,
- int (*callback) (unsigned int, unsigned int));
-
- source - is the data you want to compress.
-
- destination - is where the data should be compressed to (It would be a good
- idea to allocate ((length * 9) / 8) + 16 bytes to be sure that
- even an uncompressible file can be "compressed" without a
- page-fault.
-
- length - is the number of bytes you want to compress.
-
- workmem - a pointer to (at least) as much memory as aP_workmem_size
- returns. This is used during compression for tables and
- temporary storage needs.
-
- callback - is a pointer to a function that takes two arguments - the
- first is the number of input bytes that has been compressed,
- and the second is how many output bytes they have been
- compressed to. This function is called every 32nd time the
- main compression loop is run. If you don't have a callback,
- use NULL instead. If the function returns 1 then aP_pack
- will continue packing -- if it returns 0, aP_pack will stop
- and return 0.
-
- returns the packed length (or 0 on any error).
-
-
- aP_workmem_size:
- ----------------
- unsigned int aP_workmem_size(unsigned int inputsize);
-
- inputsize - is the number of bytes you want to compress.
-
- returns the required length of the work buffer (currently 640k).
-
-
- aP_depack:
- ----------
- unsigned int aP_depack(unsigned char *source,
- unsigned char *destination);
-
- source - is the compressed data that you want to decompress.
-
- destination - is where your want the compressed data decompressed to.
-
- returns the depacked length.
-
-
- aP_depack_asm:
- --------------
- unsigned int aP_depack_asm(unsigned char *source,
- unsigned char *destination);
-
- source - is the compressed data that you want to decompress.
-
- destination - is where your want the compressed data decompressed to.
-
- returns the depacked length.
-
-
- aP_depack_asm_fast:
- -------------------
- unsigned int aP_depack_asm_fast(unsigned char *source,
- unsigned char *destination);
-
- source - is the compressed data that you want to decompress.
-
- destination - is where your want the compressed data decompressed to.
-
- returns the depacked length.
-
-
- aP_depack16_asm:
- ----------------
- unsigned long aP_depack16_asm(unsigned char far *source,
- unsigned char far *destination);
-
- source - is the compressed data that you want to decompress.
-
- destination - is where your want the compressed data decompressed to.
-
- returns the depacked length.
-
-
-
- --- GREETINGS AND THANKS ----------------------------------------------------
-
- .. go out to the following people:
-
- * d'b for our continous discussions of compression techniques :)
- * TAD for all the great ideas and the good discussions
- * The people who made the Epsilon Compression Page
- * Pasi 'Albert' Ojala for his info on PuCrunch
- * RIT Research Labs for making Dos Navigator .. it's the BEST!
- * LiuTaoTao for making TR .. one of the best debuggers around!
- * Eugene Suslikov (SEN) for making HIEW .. it ROCKS!
- * Veit Kannegieser for his work on the VPascal code
- * METALBRAIN for his work on the 16bit depackers
- * Gautier for his work on the Ada code
- * Netscape for making the best internet browser
- * All other people who make good software freely available for non-
- commercial use!
-
- A special thanks to the beta-testers:
-
- * x-otic (thx mate ;)
- * Oleg Prokhorov (great optimizations and bug repports!)
- * Lawrence E. Boothby
- * METALBRAIN (beleive in miracles, my friend ;)
- * eL PuSHeR
- * Elli
-
-
- --- GETTING THE LATEST VERSION ----------------------------------------------
-
- You can find it at: http://apack.cjb.net/
- http://members.xoom.com/jibz/apack/news.htm
- Or the SAC archive: ftp://ftp.elf.stuba.sk/pub/pc/pack/
-
-
- --- HOW TO REACH ME ---------------------------------------------------------
-
- Well, if you have any questions, suggestions or bug-reports about aPLib (or
- you just like chatting), this email-address should work: jibz@hotmail.com
-
- If you think that aPLib is a good library and you like using it - feel
- free to send a money or hardware donation to me (will make me work
- harder ;-). Address at the end of this document, and in REGISTER.FRM.
-
- If you want to register aPLib in order to use it commercially fill out
- the registration form in REGISTER.FRM and mail it to me (if you want a
- company / site license or an update subscription email me).
-
- When you register you will receive a registered version of the libraries.
-
- Joergen Ibsen
- Post Danmark
- Poste Restante
- Veri Centret Posthus
- DK - 8240 Risskov
- Denmark.
-